package com.ukadas.eduko.negocio;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.ukadas.eduko.modelo.Alumno;
import com.ukadas.eduko.persistencia.AlumnoDao;

@Service
@Transactional(propagation=Propagation.REQUIRED)
public class GestorAlumnos  {

	@Autowired
	private AlumnoDao alumnoDao;
	
	public void setAlumnoDao(AlumnoDao alumnoDao) {
		this.alumnoDao = alumnoDao;
	}

	public void insertar(Alumno alumno)  {	
		alumnoDao.insertar(alumno);		
	}
	
	public void modificar(Alumno alumno) {
		alumnoDao.modifcar(alumno);
	}

	public void borrar(Alumno alumno) {
		alumnoDao.borrar(alumno);
	}
	
	public List<Alumno> listarTodos()  {
		return alumnoDao.listarTodos();
	}

	public Alumno buscar(int idAlumno)  {
		return alumnoDao.buscar(idAlumno);
	}
	
}
